div {
    margin: 2em;
}

.div1 {
    width: 100px;
    height: 50px;
    position: relative;
}

.div1::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: -1;
    background: #fb3;
    transform: skew(45deg);
}

.div2 {
    width: 100px;
    height: 100px;
    display: inline-block;
    transform: rotate(45deg);
    overflow: hidden;
}

.div2>img {
    max-width: 100%;
    transform: rotate(-45deg);
}

.div3 {}

.div3>img {
    max-width: 100px;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    transition: 1s;
}

.div3>img:hover {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}